<div id="main">
    <div id="contents">
        <form method="post" action="#" name="filters">
            <div class="frame_tab_layer" style="padding-left:25px;padding-top:5px;">
                <table class="cmenutitle" cellspacing="0" cellpadding="0" border="0" width="100%">
                    <tbody>
                    <tr>
                        <td id="linetype" class="frame_tab_phone" colspan="2">
                            <div class="line_position">
                                <input class="line_button" type="button" id="myLineButton" value="" name="line">
                            </div>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <fieldset>
                <legend>LINE</legend>
                <div class="frame_tab_layer">
                    <table class="cmenutitle" cellspacing="0" cellpadding="0" border="0" width="100%">
                        <tbody>
                        <tr>
                            <td class="frame_tab_left">
                                <span id="img401" class="errormsg">&nbsp;</span>
                                <label for="id401">
                                    <label sid="trunk.ID"></label>
                                </label>
                            </td>
                            <td class="frame_tab_right">
                                <input id="id401" type="text" name="id401">
                            </td>
                        </tr>
                        <tr>
                            <td class="frame_tab_left">
                                <label for="id433">
                                    <label sid="trunk.usertype"></label>
                                </label>
                            </td>
                            <td class="frame_tab_right">
                                <select id="line_type" onchange="readtype();" name="line_type">
                                    <option selected="" value="0" sid="trunk.usertype1"></option>
                                    <option value="1" sid="trunk.usertype2"></option>
                                </select>
                            </td>
                        </tr>
                        <tr id="tr469" style="display:none;">
                            <td class="frame_tab_left">
                                <span id="img469" class="errormsg">&nbsp;</span>
                                <label for="id469">
                                    <label sid="trunk.DID"></label>
                                </label>
                            </td>
                            <td class="frame_tab_right">
                                <input id="id469" type="text" onblur="read469();" name="id469">
                            </td>
                        </tr>
                        <tr id="tr468">
                            <td class="frame_tab_left">
                                <label for="id468">
                                    <label sid="trunk.greeting"></label>
                                </label>
                            </td>
                            <td class="frame_tab_right">
                                <select id="id468" name="id468">
                                    <option value="" sid="trunk.attendent"></option>
                                </select>
                            </td>
                        </tr>
                       <!-- <tr id="tr594">
                            <td class="frame_tab_left">
                                <label for="id594">
                                    <label sid="trunk.recording"></label>
                                </label>
                            </td>
                            <td class="frame_tab_right">
                                <input id="id594" type="checkbox" name="id594">
                            </td>
                        </tr>-->
                        <tr id="tr454">
                            <td class="frame_tab_left">
                                <label for="id454">
                                    <label sid="trunk.cid"></label>
                                </label>
                            </td>
                            <td class="frame_tab_right">
                                <input id="id454" type="checkbox" name="id454">
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </fieldset>
            <div class="submitFooter">
                <input class="button" type="button" name="submit" sid="sbutton.save">
                <input class="button" type="button" name="extension_stat" sid="menu.adv_cfg" id="super_button">
            </div>
        </form>
    </div>
</div>
<br>
<div id="helpContainer">
    <div id="help">
        <div>
            <h2>
                <label sid="share.help"></label>
            </h2>
        </div>
        <div id="helpBody">
            <dl>
                <dt class="term">
                    <label sid="trunk.usertype"></label>
                </dt>
                <dd class="definition">
                    <label sid="trunk.usertype1"></label><br>
                    <label sid="trunk.usertype1_note"></label><br><br>
                    <label sid="trunk.usertype2"></label><br>
                    <label sid="trunk.usertype2_note"></label>
                </dd>

            </dl>

        </div>
    </div>
</div>
<script type="text/javascript" src="js/getSelectList.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        var sendtext = "&id=4001&id=771";
        getSelectList(sendtext);

        $("[name=submit]").click(function () {
            $(".errormsg").html('');
            var nonames = new Array("line","submit","extension_batch","extension_stat","add_extension","ip_extension_batch","ip_extension_stat","id366","id584","id469","line_type");
            var settext = "&line_id="+getCookie("line_id");
            settext += getSetText(nonames);
            if($("#id469").val()!==""&&$("#id469").val()){
                settext+="&id437=on&id447=off&id469="+$("#id469").val();
            }else{
                settext+="&id437=off&id447=off&id469="+$("#id469").val();
            }
            settext=settext.replace(/\#/g,"%23");
            submitform(modules["set_data"],settext);

        });
        $("#super_button").bind("click",function(){
            loadNewHtml("trunk_more.htm");
        });
    });

	function readtype(){
		if($("#line_type").val()==1){
				$("#tr469").show();
				$("#tr468").hide();
			}else if($("#line_type").val()==0){
				$("#tr469").hide();
				$("#tr468").show();
				$("#id469").attr("value","");
			}else{
					$("#tr469").hide();
					$("#id469").attr("value","");
					$("#tr468").show();
			}
		}
</script>

